package com.im.common.initialize;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * 
 * 容器启动后要初始化执行的操作
 * 
 */
@Component
public class AppInitializer implements ApplicationListener<ContextRefreshedEvent> {
	private static final Logger logger = Logger.getLogger(AppInitializer.class);


	@Override
	public void onApplicationEvent(ContextRefreshedEvent e) {
		if (e.getApplicationContext().getParent() == null) {
			if (logger.isInfoEnabled()) {
				logger.info(this.getClass() + "：系统初始化菜单用户。");
			}
		}
	}
}
